﻿<%@ Page Language="C#" MasterPageFile="~/Manager.master" AutoEventWireup="true" CodeFile="Rate.aspx.cs"
    Inherits="Manager_Rate_Rate" Title="Untitled Page" %>

<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/javascript">
      function Picker1_onSelectionChanged(sender, eventArgs)
      {
        cldStart.SetSelectedDate(Picker1.GetSelectedDate());   
        cldStart.Show();
      }
      function cldStart_onSelectionChanged(sender, eventArgs)
      {
            var fromDate = cldStart.GetSelectedDate();
            Picker1.SetSelectedDate(fromDate);        
           /*var fromDate = cldStart.GetSelectedDate();
            var toDate = cldEnd.GetSelectedDate();
            Picker1.SetSelectedDate(fromDate);       if(fromDate > toDate)
            {
              Picker2.SetSelectedDate(fromDate);
              cldEnd.SetSelectedDate(fromDate);
            }  */             
      }
    </script>

    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td>
                <table border="1" bordercolor="#407db3" cellpadding="2" cellspacing="2" class="tbl_Comon-Search"
                    style="border-collapse: collapse" width="100%">
                    <tr>
                        <td align="center" colspan="1" rowspan="1" style="width: 30px" valign="top">
                            <asp:Button ID="btnSearch" runat="server" CssClass="cssButton" Text="Tìm kiếm" OnClick="btnSearch_Click1" /></td>
                        <td class="td_Title" nowrap="nowrap" style="width: 54px">
                            <asp:Label ID="Label2" runat="server" CssClass="lbl_Common-Search" Text="Ngày:"></asp:Label></td>
                        <td class="td_Control" lang="td_Title" nowrap="nowrap">
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tbody>
                                    <tr>
                                        <td>
                                        </td>
                                        <td align="center">
                                            <ComponentArt:Calendar ID="Picker1" runat="server" ControlType="Picker" PickerCssClass="picker" 
                                                PickerCustomFormat="dd/MM/yyyy" PickerFormat="Custom"  ClientSideOnSelectionChanged="Picker1_onSelectionChanged">
                                            </ComponentArt:Calendar>
                                        </td>
                                        <td>
                                            &nbsp;
                                            <img id="calendar_start_button" alt="" class="calendar_button" height="22" onclick="cldStart .SetSelectedDate(Picker1.GetSelectedDate());cldStart .Show();"
                                                src="../../Images/Icon/btn_calendar.gif" width="25" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="7" rowspan="1" valign="top">
                            &nbsp;<asp:Button ID="btnAdd_Catalogue" runat="server" CssClass="cssButton" Text="Thêm mới"
                                OnClick="btnAdd_Catalogue_Click" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="grv_Master" runat="server" Width="100%" PageSize="20" OnRowDeleting="grv_Master_RowDeleting"
                    OnRowDataBound="grv_Master_RowDataBound" OnRowCreated="grv_Master_RowCreated"
                    BorderColor="#407DB3" CellPadding="2" DataKeyNames="RateID" AutoGenerateColumns="False"
                    AllowSorting="True" AllowPaging="True" OnPageIndexChanging="grv_Master_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <img id='imgedit' alt="Edit" runat="server" border="0" onclick="OpenProductDetail(this)"
                                    rateid='<%# Eval("RateID") %>' src="../../Images/Icon/cmdEdit.gif" style="cursor: pointer" />
                            </ItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Wrap="False" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lblDelete" runat="server" CommandName="delete" Text="<img src=../../Images/Icon/cmdDelete.gif border=0 alt=Delete > "></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                            <HeaderStyle CssClass="cssBorderGrv" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="RateDate" HeaderText="Ng&#224;y cập nhật">
                            <HeaderStyle CssClass="cssBorderGrv"  Wrap="false"/>
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="USD" HeaderText="USD">
                            <HeaderStyle CssClass="cssBorderGrv" />
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="15%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="BankNm" HeaderText="Tên Ngân Hàng">
                            <HeaderStyle CssClass="cssBorderGrv" />
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" Width="60%" />
                        </asp:BoundField>
                        <asp:BoundField DataField="UserNm" HeaderText="Nguoi Cap Nhat">
                            <HeaderStyle CssClass="cssBorderGrv" Wrap="false" />
                            <ItemStyle CssClass="cssBorderGrv" HorizontalAlign="Center" />
                        </asp:BoundField>
                    </Columns>
                    <RowStyle CssClass="gvRowStyle" HorizontalAlign="Center" />
                    <AlternatingRowStyle CssClass="gvAlternatingRowStyle" />
                    <HeaderStyle CssClass="gvHeader" Wrap="False" />
                </asp:GridView>
            </td>
        </tr>
    </table>
    <br />
    <ComponentArt:Calendar ID="cldStart" runat="server" AllowMonthSelection="False" AllowMultipleSelection="False"
        AllowWeekSelection="False" CalendarCssClass="calendar" CalendarTitleCssClass="title"
        ControlType="Calendar" DayCssClass="day" DayHeaderCssClass="dayheader" DayHoverCssClass="dayhover"
        DayNameFormat="Full" MonthCssClass="month" NextImageUrl="../../Images/Icon/cal_nextMonth.gif"
        NextPrevCssClass="nextprev" OtherMonthDayCssClass="othermonthday" PopUp="Custom"
        PopUpExpandControlId="calendar_start_button" PrevImageUrl="../../Images/Icon/cal_prevMonth.gif"
        SelectedDate="" SelectedDayCssClass="selectedday" SelectMonthCssClass="selector"
        SelectMonthText="¤" SelectWeekCssClass="selector" SelectWeekText="»" SwapDuration="300"
        SwapSlide="Linear" VisibleDate="" ClientSideOnSelectionChanged="cldStart_onSelectionChanged">
    </ComponentArt:Calendar>

    <script language="javascript" type="text/javascript">
function OpenProductDetail(obj)
{   		    
	    var RateID=obj.getAttribute("RateID");
	    var CodeID='<%= Request.QueryString["CodeID"]%>';
	    window.location.href="AddRate.aspx?CodeID="+CodeID+"&RateID="+RateID;    

}

    </script>

</asp:Content>
